<?php
class CookieHandle {
	private $domain = array();
	private $db;
	
	function CookieHandle(& $db) {
		$this->db = $db;
		$selectAllClientDomain = "SELECT `domain` FROM `sso_client`";
		$this->domain = $this->db->GetAll($selectAllClientDomain);
$_SESSION['domain'] = $this->domain;
	}
	
	public function setClientCookie($result) {
			setcookie("ss123", "123"); 
			//setcookie("ss123", "123", time()+3600, "/", ".fengtop.net"); 
		for ($i = 0; $i < count($this->domain); $i++) {
//			setcookie("uid"            , $result['uid']            , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("username"       , $result['username']       , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("password"       , $result['password']       , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("email"          , $result['email']          , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("user_sex"       , $result['user_sex']       , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("status"         , $result['status']         , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("emailstatus"    , $result['emailstatus']    , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("regdate"        , $result['regdate']        , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("regip"          , $result['regip']          , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("lastlogintime"  , $result['lastlogintime']  , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("lastloginip"    , $result['lastloginip']    , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("question"       , $result['question']       , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("uanswer"        , $result['uanswer']        , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
//			setcookie("ticket"         , $result['ticket']         , COOKIE_TIME?(time()+COOKIE_TIME):0, "/", $this->domain[$i]['domain']); 
		}
	}
	
}

?>